{% extends 'base.html' %}

{% block title %}登录{% endblock %}

{% block body %}
    {{ super() }}
<!-- login section ends -->
<section class="login">
    <h1 class="heading"> <span>登录</span> Login </h1>
    <div class="row">
        <form action='/login' method="post" novalidate>
            {{ form.csrf_token() }}

            {{ form.name }}
            {% if form.name.errors.0 %}
            <div class="error">
                <span>{{ form.name.errors.0 }}</span>
            </div>
            {% endif %}

            {{ form.password }}
            {% if form.password.errors.0 %}
            <div class="error">
                <span>{{ form.password.errors.0 }}</span>
            </div>
            {% endif %}
            <!--
            <input type="text" name="name" placeholder="请输入用户名" class="box">
            <input type="password" name="password" placeholder="请输入密码" class="box">
            -->
            <div class="flex justify-center">
                <div id="verify"></div>
                <input type="hidden" name="token">
            </div>

            <div class="loginBtn">
                <!--
                <input type="submit" value="登录" class="btn gradient">
                -->
                {{ form.submit() }}
            </div>

            <div class="flex justify-end fw5 f3">
                <a class="pa3" href="/register">没有帐号,点我注册<i class="fas fa-registered"></i></a>
            </div>

            {% if tips %}
            <div class="errors">
                <span>{{ tips }}</span>
            </div>
            {% endif %}
            
        </form>
    </div>
</section>
<!-- login section ends -->  
{% endblock %}
